using System;
using System.Web.UI;

using DotNetNuke;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Exceptions;

namespace Personify.Modules.UserLocator
{
    /// <summary>
    /// The module settings class.
    /// </summary>
    partial class Settings : ModuleSettingsBase
    {
        /// <summary>
        /// Loads the module settings.
        /// </summary>
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

        /// <summary>
        /// Updates the modules settings.
        /// </summary>
        public override void UpdateSettings()
        {
            try
            {
                ModuleController mc = new ModuleController();
                mc.UpdateModuleSetting(this.ModuleId, "GoogleMapsKey", txtGoogleMapsKey.Text);

                //refresh cache
                ModuleController.SynchronizeModule(this.ModuleId);
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

    }
}


